All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.image.QTEffect

java.lang.Object
   |
   +----quicktime.app.image.QTEffect

public class QTEffect
extends Object
implements QTDrawable, Redrawable
QTEffect forms the base class for visual effects that can be applied to images. Depending on the effect itself, visual effects can be applied over a length of time, or once only. They can be applied to no source images, a single image or multiple images.

The QTEffect class itself forms a base class that given a rectangular region will apply some visual effect (like fire/ripples). to its destination graphics. There are two subclasses - QTFilter which is an effect that is applied to a single source image and QTTransition which is an effect that is applied to two images, transitioning from the source image to the destination image.


Constructor Index

 o QTEffect()
Creates a QTEffect with kMultiFrame set with a default initial size of 0, 0.
 o QTEffect(Dimension)
Creates a QTEffect with kMultiFrame set and the specified initial size.
 o QTEffect(int)
Creates a QTEffect with kMultiFrame set with a default initial size of 0, 0.
 o QTEffect(int, Dimension)
Creates a QTEffect.

Method Index

 o addedTo(Object)
This method is called by the specified object when the instance of the class that implements this interface is added to the object that is the source of the interest.
 o checkForEffect(int)
This will make sure the component (effect) is there and can set its parameter list for display.
 o getClip()
Returns the current clipping region of the effect or null if the effect is not clipped
 o getCurrentFrame()
This returns the current frame that the effect is rendering.
 o getDescription()
This method should return an ImageDescription that describes the image data that the class contains.
 o getDisplayBounds()
QTCanvas calls this method when it needs to ask the client for its boundary.
 o getDSequence()
Returns the DSequence that is used by the QTEffect.
 o getEffect()
This will return a copy of the AtomContainer that contains the current effect settings.
 o getFrames()
Returns the current maximum number of frames that an effect will run for
 o getGraphicsMode()
This gets the current GraphicsMode for the QTEffect.
 o getGWorld()
QTCanvas calls this method to get the destination QDGraphics of its client.
 o getImage()
This method returns the actual image data - in this case the effect's atom container.
 o getInitialSize()
This method returns the original size before the transformations specified in the returned matrix are applied.
 o getMatrix()
This will return the client's current display transformations
 o isRedrawing()
Returns the state of the redraw flag
 o isSingleFrame()
Returns true if the Redrawable only has a single frame to render and thus will never need to re-acquire or redraw its image.
 o redraw(Region)
QTCanvas calls this method when the client should redraw itself.
 o removedFrom(Object)
This method is called by the specified object when the instance of the class that implements this interface is removed from the object that is the source of the interest.
 o setClip(Region)
This will set the clipping of the effect - it defines the region of the source image that the effect will be applied to.
 o setDisplayBounds(QDRect)
QTCanvas calls this method when it needs to tell the client to adjust its location, width and/or height.
 o setEffect(AtomContainer)
This method will take the incoming parameters and use this as the control parameters for the effect.
 o setGraphicsMode(GraphicsMode)
This sets the GraphicsMode for the Compositor when it draws its composited contents to its destination QDGraphics (typically the QTCanvas).
 o setGWorld(QDGraphics)
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing.
 o setLocation(int, int)
A convenience method to set the position of a QTDrawable object.
 o setMatrix(Matrix)
This method sets the current matrix of the Transformable object to the new matrix.
 o setRedrawing(boolean)
If true then the current frame of the effect is drawn on redraw.
 o setUpSequence()
This method is called by a number of other methods to create the DSequence that is used to render the QTEffect.

Constructors

 o QTEffect
 public QTEffect() throws QTException
Creates a QTEffect with kMultiFrame set with a default initial size of 0, 0.

 o QTEffect
 public QTEffect(Dimension d) throws QTException
Creates a QTEffect with kMultiFrame set and the specified initial size.

Parameters:
d - the initialSize of the effect.
 o QTEffect
 public QTEffect(int multiFrameFlag) throws QTException
Creates a QTEffect with kMultiFrame set with a default initial size of 0, 0.

Parameters:
multiFrameFlag - is normally set to kMultiFrame. The setting of this flag will also set the initial setting of the redrawing flag. QTEffects require redrawing so the default value is kMultiFrame. Typically the QTFilters do not require redrawing so their default value is kSingleFrame. QTTransitions are multiframes and so do require redrawing.
 o QTEffect
 public QTEffect(int multiFrameFlag,
                 Dimension d) throws QTException
Creates a QTEffect. The specified multiFrameFlag parameter should be set to Redrawable.kMultiFrame as all of the existing QTEffects require redrawing for their visual effect to be apparent.

Parameters:
multiFrameFlag - is normally set to kMultiFrame. The setting of this flag will also set the initial setting of the redrawing flag. QTEffects require redrawing so the default value is kMultiFrame. Typically the QTFilters do not require redrawing so their default value is kSingleFrame. QTTransitions are multiframes and so do require redrawing.
d - the initialSize of the effect.

Methods

 o setRedrawing
 public void setRedrawing(boolean redrawFlag)
If true then the current frame of the effect is drawn on redraw. If false then the effect is only applied when you explicitly apply it For an effect or a filter the default setting for this flag is true - the effect is redrawn on redraw. For a Transition the default setting for this flag is false - the source of the effect only is redrawn.

Parameters:
redrawFlag - boolean indicating redraw behaviour
 o isRedrawing
 public boolean isRedrawing()
Returns the state of the redraw flag

Returns:
boolean
 o isSingleFrame
 public boolean isSingleFrame()
Returns true if the Redrawable only has a single frame to render and thus will never need to re-acquire or redraw its image. Certain Redrawable objects are able to optimise their resources knowing this constraint.

 o setGraphicsMode
 public void setGraphicsMode(GraphicsMode mode) throws QTException
This sets the GraphicsMode for the Compositor when it draws its composited contents to its destination QDGraphics (typically the QTCanvas).

 o getGraphicsMode
 public GraphicsMode getGraphicsMode()
This gets the current GraphicsMode for the QTEffect.

 o setClip
 public void setClip(Region r) throws StdQTException
This will set the clipping of the effect - it defines the region of the source image that the effect will be applied to.

Parameters:
r - the clipping region
 o getClip
 public Region getClip()
Returns the current clipping region of the effect or null if the effect is not clipped

 o getEffect
 public AtomContainer getEffect() throws StdQTException
This will return a copy of the AtomContainer that contains the current effect settings. You can alter the values of this container but you must call setEffect for those new values to be used by the effect.

 o setEffect
 public void setEffect(AtomContainer effectParams) throws QTException
This method will take the incoming parameters and use this as the control parameters for the effect. The container will be locked for the duration of the effect object's life or until another effect is set.

Parameters:
effectParams - the parameters that determine the effect that is run
 o setUpSequence
 protected synchronized boolean setUpSequence() throws QTException
This method is called by a number of other methods to create the DSequence that is used to render the QTEffect. When called the method will create a new DSequence if the required state has been established to enable the creation of the DSequence.

Returns:
true if a new DSequence was created, otherwise false.
 o getFrames
 public int getFrames()
Returns the current maximum number of frames that an effect will run for

 o getCurrentFrame
 public int getCurrentFrame()
This returns the current frame that the effect is rendering.

Returns:
the current frame
 o checkForEffect
 public void checkForEffect(int effectType) throws QTException
This will make sure the component (effect) is there and can set its parameter list for display. If the effect is not present then an exception with a paramErr will be thrown

Parameters:
effectType - the effect type to check for
 o addedTo
 public void addedTo(Object interest)
This method is called by the specified object when the instance of the class that implements this interface is added to the object that is the source of the interest.

Parameters:
interest - the object that is to be the source of interest for the the object that implements this interface.
 o removedFrom
 public void removedFrom(Object interest)
This method is called by the specified object when the instance of the class that implements this interface is removed from the object that is the source of the interest.

Parameters:
interest - the object that was the source of interest for the the object that implements this interface.
 o setGWorld
 public synchronized void setGWorld(QDGraphics cgp) throws QTException
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing. If the incoming QDGraphics is the QDGraphics.scratch then the drawable will not be visible and can disable itself. If a client is unable to set the graphics world it should throw an exception.

Parameters:
cgp - a QDGraphics object
 o getGWorld
 public synchronized QDGraphics getGWorld() throws QTException
QTCanvas calls this method to get the destination QDGraphics of its client.

Returns:
a QDGraphics object or null
 o setDisplayBounds
 public synchronized void setDisplayBounds(QDRect bounds) throws QTException
QTCanvas calls this method when it needs to tell the client to adjust its location, width and/or height. All values are in pixels.

Parameters:
bounds - the new size and location.
 o setLocation
 public void setLocation(int x,
                         int y) throws QTException
A convenience method to set the position of a QTDrawable object.

Parameters:
x - the new x location
y - the new y location
 o getDisplayBounds
 public QDRect getDisplayBounds() throws QTException
QTCanvas calls this method when it needs to ask the client for its boundary. All values are in pixels.

Returns:
the display boundary of the client
 o getDSequence
 public DSequence getDSequence()
Returns the DSequence that is used by the QTEffect. This object may be null if the QTEffect is not currently attached to a valid destination QDGraphics. The application should not cache this sequence object for any length of time - as if the destination QDGraphics is changed the DSequence is thrown away and a new one is created.

 o getImage
 public EncodedImage getImage()
This method returns the actual image data - in this case the effect's atom container.

Returns:
the image data
 o getDescription
 public ImageDescription getDescription() throws QTException
This method should return an ImageDescription that describes the image data that the class contains.

Returns:
the ImageDescription of an Image
 o getInitialSize
 public Dimension getInitialSize() throws QTException
This method returns the original size before the transformations specified in the returned matrix are applied.

Returns:
a Dimension
 o getMatrix
 public Matrix getMatrix() throws QTException
This will return the client's current display transformations

Returns:
the display transformations of the client
 o setMatrix
 public void setMatrix(Matrix matrix) throws QTException
This method sets the current matrix of the Transformable object to the new matrix.

 o redraw
 public synchronized void redraw(Region invalidRgn) throws QTException
QTCanvas calls this method when the client should redraw itself. If the canvas is able to discern that only a part of the client's drawing area needs to be redrawn - then this area shall be passed in using the invalidRgn. Otherwise this will be null in which case the client should redraw itself entirely.

Parameters:
invalidRgn - the invalidRgn that the client should redraw

All Packages  Class Hierarchy  This Package  Previous  Next  Index